package org.example.service.impl;

import org.example.domain.entity.UserAddr;
import org.example.domain.entity.UsersS ;
import org.example.domain.model.Result;
import org.example.mapper.AddrUserMapper;
import org.example.service.IAddrUserService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class AddrUserServiceImpl implements IAddrUserService {

    private AddrUserMapper addrUserMapper;

    public AddrUserServiceImpl(AddrUserMapper addrUserMapper) {
        this.addrUserMapper = addrUserMapper;
    }

    @Override
    public Result queryAllAddr() {
        List<UsersS> users = addrUserMapper.userAddr();
        Map<String, Object> data = new HashMap<>();
        data.put("total",users.size());
        data.put("user",users);
        return Result.buildSuccess(data);
    }
}
